PHP for Beginners: Your Guide to Easily Learn PHP In 7 Days by iCode Academy

PHP for Beginners: Your Guide to Easily Learn PHP In 7 Days by iCode Academy

Author:iCode Academy [Academy, iCode]
Language: eng
Format: azw3
Published: 2017-08-15T04:00:00+00:00


At this point, you should be able to see the mydir directory inside the htdocs directory. If you try to create a new directory and name it mydir, PHP will return an error.

To illustrate, you can run the dir.php file again on your localhost. Here’s what you might see:

Copying Files between Directories

The PHP copy() function is used to copy a file between locations. It takes both the source and the destination path as parameters. By default, an existing destination file is overwritten.

This example will show how you can copy the file try.php to an htdocs subfolder named backup. You will have to create the backup directory first. Otherwise, PHP will raise an error. Similarly, the try.php must be an existing file. You can save this code in the notepad as new.php:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.